import {Component} from 'react';
import style from './index.css';
import {Table, Icon} from 'antd';
export default class TableComponent extends Component {
  constructor (props) {
    super (props);
    this.state = {
      dataSource: [
        {
          id: '1',
          name: '胡彦斌',
          age: 32,
          address: '西湖区湖底公园1号',
        },
        {
          id: '2',
          name: '胡彦祖',
          age: 42,
          address: '西湖区湖底公园1号',
        },
      ],
      columns: [
        {
          title: '姓名',
          dataIndex: 'name',
          key: 'name',
        },
        {
          title: '年龄',
          dataIndex: 'age',
          key: 'age',
        },
        {
          title: '住址',
          dataIndex: 'address',
          key: 'address',
        },
      ],
    };
  }

  render () {
    return (
      <div className={style.table_box}>
        <Table
          dataSource={this.state.dataSource}
          columns={this.state.columns}
          bordered
        />
      </div>
    );
  }
}
